<!DOCTYPE html>
<html>
<head>
<title>FridgeOre Mining Group</title>
<meta charset="utf-8">
<link href="../style.css" rel="stylesheet" type="text/css">
<?
include_once "uconnect.php";

$query = mysql_query("SELECT * FROM prices ORDER by id");
	$pDA = array();
	while ($rows = mysql_fetch_assoc($query))
		{	$pDA[$rows['mineral']]=$rows;	}

// Convert Prices to ISKs and Cents Function
function cents($modMe){
	$i = $modMe / 100;
	return number_format($i, 2);
}
		
// Rename those prices for less typing
$ptri = cents($pDA['tritanium']['price']);
$ppye = cents($pDA['pyerite']['price']);
$pmex = cents($pDA['mexallon']['price']);
$piso = cents($pDA['isogen']['price']);
$pnoc = cents($pDA['nocxium']['price']);
$pzyd = cents($pDA['zydrine']['price']);
$pmeg = cents($pDA['megacyte']['price']);
$pmor = cents($pDA['morphite']['price']);


		
?>
</head>
<body>
    <div id="wrapper">
        <div id="head">
        <div id="header">
            <p>FridgeOre Mining Group</p>
            <p><span id="copyrite">An Eve Online © Corporation</span></p>
        </div>
        </div>
        <div id="leftcolumnwrap">
        <div id="leftcolumn"><? include "../nav.php"; ?></div>
        </div>
        <div id="contentwrap">
        <div id="content">
<script Language="JavaScript">
    var Materials = new Array('Tritanium', 'Pyerite', 'Mexallon', 'Isogen', 'Nocxium', 'Zydrine', 'Megacyte', 'Morphite');
     
    var Asteroids = new Array();
    Asteroids['Veldspar'] = new Array();
    Asteroids['Veldspar']['Batchsize'] = 333;
    Asteroids['Veldspar']['m3'] = 0.1;
    Asteroids['Veldspar']['Materials'] = new Array();
    Asteroids['Veldspar']['Materials']['Tritanium'] = 1000;
     
    Asteroids['Scordite'] = new Array();
    Asteroids['Scordite']['Batchsize'] = 333;
    Asteroids['Scordite']['m3'] = 0.15;
    Asteroids['Scordite']['Materials'] = new Array();
    Asteroids['Scordite']['Materials']['Tritanium'] = 833;
    Asteroids['Scordite']['Materials']['Pyerite'] = 416;
     
    Asteroids['Pyroxeres'] = new Array();
    Asteroids['Pyroxeres']['Batchsize'] = 333;
    Asteroids['Pyroxeres']['m3'] = 0.3;
    Asteroids['Pyroxeres']['Materials'] = new Array();
    Asteroids['Pyroxeres']['Materials']['Tritanium'] = 844;
    Asteroids['Pyroxeres']['Materials']['Pyerite'] = 59;
    Asteroids['Pyroxeres']['Materials']['Mexallon'] = 120;
    Asteroids['Pyroxeres']['Materials']['Nocxium'] = 11;
     
    Asteroids['Plagioclase'] = new Array();
    Asteroids['Plagioclase']['Batchsize'] = 333;
    Asteroids['Plagioclase']['m3'] = 0.35;
    Asteroids['Plagioclase']['Materials'] = new Array();
    Asteroids['Plagioclase']['Materials']['Tritanium'] = 256;
    Asteroids['Plagioclase']['Materials']['Pyerite'] = 512;
    Asteroids['Plagioclase']['Materials']['Mexallon'] = 256;
     
    Asteroids['Kernite'] = new Array();
    Asteroids['Kernite']['Batchsize'] = 400;
    Asteroids['Kernite']['m3'] = 1.2;
    Asteroids['Kernite']['Materials'] = new Array();
    Asteroids['Kernite']['Materials']['Tritanium'] = 386;
    Asteroids['Kernite']['Materials']['Mexallon'] = 773;
    Asteroids['Kernite']['Materials']['Isogen'] = 386;
     
    Asteroids['Omber'] = new Array();
    Asteroids['Omber']['Batchsize'] = 500;
    Asteroids['Omber']['m3'] = 0.6;
    Asteroids['Omber']['Materials'] = new Array();
    Asteroids['Omber']['Materials']['Tritanium'] = 307;
    Asteroids['Omber']['Materials']['Pyerite'] = 123;
    Asteroids['Omber']['Materials']['Isogen'] = 307;
     
    Asteroids['Jaspet'] = new Array();
    Asteroids['Jaspet']['Batchsize'] = 500;
    Asteroids['Jaspet']['m3'] = 2;
    Asteroids['Jaspet']['Materials'] = new Array();
    Asteroids['Jaspet']['Materials']['Tritanium'] = 259;
    Asteroids['Jaspet']['Materials']['Pyerite'] = 259;
    Asteroids['Jaspet']['Materials']['Mexallon'] = 518;
    Asteroids['Jaspet']['Materials']['Nocxium'] = 259;
    Asteroids['Jaspet']['Materials']['Zydrine'] = 8;
     
    Asteroids['Hemorphite'] = new Array();
    Asteroids['Hemorphite']['Batchsize'] = 500;
    Asteroids['Hemorphite']['m3'] = 3;
    Asteroids['Hemorphite']['Materials'] = new Array();
    Asteroids['Hemorphite']['Materials']['Tritanium'] = 212;
    Asteroids['Hemorphite']['Materials']['Isogen'] = 212;
    Asteroids['Hemorphite']['Materials']['Nocxium'] = 424;
    Asteroids['Hemorphite']['Materials']['Zydrine'] = 28;
     
    Asteroids['Hedbergite'] = new Array();
    Asteroids['Hedbergite']['Batchsize'] = 500;
    Asteroids['Hedbergite']['m3'] = 3;
    Asteroids['Hedbergite']['Materials'] = new Array();
    Asteroids['Hedbergite']['Materials']['Isogen'] = 708;
    Asteroids['Hedbergite']['Materials']['Nocxium'] = 354;
    Asteroids['Hedbergite']['Materials']['Zydrine'] = 32;
     
    Asteroids['Spodumain'] = new Array();
    Asteroids['Spodumain']['Batchsize'] = 250;
    Asteroids['Spodumain']['m3'] = 16;
    Asteroids['Spodumain']['Materials'] = new Array();
    Asteroids['Spodumain']['Materials']['Tritanium'] = 700;
    Asteroids['Spodumain']['Materials']['Pyerite'] = 140;
    Asteroids['Spodumain']['Materials']['Megacyte'] = 140;
     
    Asteroids['Gneiss'] = new Array();
    Asteroids['Gneiss']['Batchsize'] = 400;
    Asteroids['Gneiss']['m3'] = 5;
    Asteroids['Gneiss']['Materials'] = new Array();
    Asteroids['Gneiss']['Materials']['Tritanium'] = 171;
    Asteroids['Gneiss']['Materials']['Mexallon'] = 171;
    Asteroids['Gneiss']['Materials']['Isogen'] = 343;
    Asteroids['Gneiss']['Materials']['Zydrine'] = 171;
     
    Asteroids['DarkOchre'] = new Array();
    Asteroids['DarkOchre']['Batchsize'] = 400;
    Asteroids['DarkOchre']['m3'] = 8;
    Asteroids['DarkOchre']['Materials'] = new Array();
    Asteroids['DarkOchre']['Materials']['Tritanium'] = 250;
    Asteroids['DarkOchre']['Materials']['Nocxium'] = 500;
    Asteroids['DarkOchre']['Materials']['Zydrine'] = 250;
     
    Asteroids['Crokite'] = new Array();
    Asteroids['Crokite']['Batchsize'] = 250;
    Asteroids['Crokite']['m3'] = 16;
    Asteroids['Crokite']['Materials'] = new Array();
    Asteroids['Crokite']['Materials']['Tritanium'] = 331;
    Asteroids['Crokite']['Materials']['Isogen'] = 331;
    Asteroids['Crokite']['Materials']['Zydrine'] = 663;
     
    Asteroids['Bistot'] = new Array();
    Asteroids['Bistot']['Batchsize'] = 200;
    Asteroids['Bistot']['m3'] = 16;
    Asteroids['Bistot']['Materials'] = new Array();
    Asteroids['Bistot']['Materials']['Pyerite'] = 170;
    Asteroids['Bistot']['Materials']['Zydrine'] = 341;
    Asteroids['Bistot']['Materials']['Megacyte'] = 170;
     
    Asteroids['Arkonor'] = new Array();
    Asteroids['Arkonor']['Batchsize'] = 200;
    Asteroids['Arkonor']['m3'] = 16;
    Asteroids['Arkonor']['Materials'] = new Array();
    Asteroids['Arkonor']['Materials']['Tritanium'] = 300;
    Asteroids['Arkonor']['Materials']['Zydrine'] = 166;
    Asteroids['Arkonor']['Materials']['Megacyte'] = 333;
     
    Asteroids['Mercoxit'] = new Array();
    Asteroids['Mercoxit']['Batchsize'] = 250;
    Asteroids['Mercoxit']['m3'] = 40;
    Asteroids['Mercoxit']['Materials'] = new Array();
    Asteroids['Mercoxit']['Materials']['Morphite'] = 530;

    function UpdateList ()
    {
    for (var i in Materials)
    {
    var Material = Materials[i];
    eval ("var "+Material+"Price = parseFloat(document.getElementById(\""+Material+"Price\").value);");
    }
    for (var i in Asteroids)
    {
    var Asteroid = Asteroids[i];
    var Price = 0;
     
    for (var j in Asteroid['Materials'])
    {
    eval ("var MaterialPrice = "+j+"Price;");
    if (MaterialPrice > 0 && Price >= 0)
    {
    Price += MaterialPrice * Asteroid['Materials'][j];
    }
    else
    {
    Price = -1;
    break;
    }
    }
    if (Price >= 0)
    {
    var PricePerUnit = Math.round(Price / Asteroid['Batchsize']*100)/100;
    var PricePerM3 = Math.round(((Price / Asteroid['Batchsize']) / Asteroid['m3'])*100)/100;
    if ((PricePerUnit*100)%10 == 0)
    {
    PricePerUnit = String.concat(PricePerUnit+"0");
    }
    if ((PricePerM3*100)%10 == 0)
    {
    PricePerM3 = String.concat(PricePerM3+"0");
    }
    }
    else
    {
    PricePerUnit = 0.00;
    PricePerM3 = 0.00;
    }
    document.getElementById(i+"_Unit").innerHTML = PricePerUnit;
    document.getElementById(i+"_m3").innerHTML = PricePerM3;
    }
    }
    </script>
    </head>
    <body onLoad="javascript:UpdateList();">
    <table width="625" align="center" onMouseOver="javascript:UpdateList();">
      <th colspan="8">Material Prices</th>
	    <tr align="center">
        	<td>Tritanium: $<? echo $ptri; ?></td>
        	<td>Pyerite: $<? echo $ppye; ?></td>
        	<td>Mexallon: $<? echo $pmex; ?></td>
        	<td>Isogen: $<? echo $piso; ?></td>
		</tr>
 		<tr align="center">
        	<td><input class="TxtField" id="TritaniumPrice" onKeyUp="javascript:UpdateList();" onChange="javascript:UpdateList();" size="15" width="20"></td>
        	<td><input class="TxtField" id="PyeritePrice" onKeyUp="javascript:UpdateList();" onChange="javascript:UpdateList();" size="15" width="20"></td>
        	<td><input class="TxtField" id="MexallonPrice" onKeyUp="javascript:UpdateList();" onChange="javascript:UpdateList();" size="15" width="20"></td>
        	<td><input class="TxtField" id="IsogenPrice" onKeyUp="javascript:UpdateList();" onChange="javascript:UpdateList();" size="15" width="20"></td>        
        </tr>
        <tr align="center">
        	<td>Nocxium: $<? echo $pnoc; ?></td>
        	<td>Zydrine: $<? echo $pzyd; ?></td>
        	<td>Megacyte: $<? echo $pmeg; ?></td>
        	<td>Morphite: $<? echo $pmor; ?></td>
        </tr>
        <tr align="center">
        	<td><input class="TxtField" id="NocxiumPrice" onKeyUp="javascript:UpdateList();" onChange="javascript:UpdateList();" size="15" width="20"></td>
        	<td><input class="TxtField" id="ZydrinePrice" onKeyUp="javascript:UpdateList();" onChange="javascript:UpdateList();" size="15" width="20"></td>
        	<td><input class="TxtField" id="MegacytePrice" onKeyUp="javascript:UpdateList();" onChange="javascript:UpdateList();" size="15" width="20"></td>
        	<td><input class="TxtField" id="MorphitePrice" onKeyUp="javascript:UpdateList();" onChange="javascript:UpdateList();" size="15" width="20"></td>
		</tr>
	</table>
	<table align="center" border="0" width="350">
    	<th colspan="3">Ore Values</th>
    <tr align="center">
    	<td>Asteroid</td>
        <td>ISK per M³</td>
        <td>ISK per Unit</td>
    </tr>
           <tr>
              <td ><div align="right">Veldspar:</div></td>
              <td  align="right"><span id="Veldspar_m3">---</span></td>
              <td  align="right"><span id="Veldspar_Unit">---</span></td>
        <tr>
                <td ><div align="right">Scordite:</div></td>
                <td  align="right"><span id="Scordite_m3">---</span></td>
                <td  align="right"><span id="Scordite_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Plagioclase:</div></td>
              <td  align="right"><span id="Plagioclase_m3">---</span></td>
              <td  align="right"><span id="Plagioclase_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Pyroxeres:</div></td>
              <td  align="right"><span id="Pyroxeres_m3">---</span></td>
              <td  align="right"><span id="Pyroxeres_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Kernite:</div></td>
              <td  align="right"><span id="Kernite_m3">---</span></td>
              <td  align="right"><span id="Kernite_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Omber:</div></td>
              <td  align="right"><span id="Omber_m3">---</span></td>
              <td  align="right"><span id="Omber_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Jaspet:</div></td>
              <td  align="right"><span id="Jaspet_m3">---</span></td>
              <td  align="right"><span id="Jaspet_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Hemorphite:</div></td>
              <td  align="right"><span id="Hemorphite_m3">---</span></td>
              <td  align="right"><span id="Hemorphite_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Hedbergite:</div></td>
              <td  align="right"><span id="Hedbergite_m3">---</span></td>
              <td  align="right"><span id="Hedbergite_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Spodumain:</div></td>
              <td  align="right"><span id="Spodumain_m3">---</span></td>
              <td  align="right"><span id="Spodumain_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Gneiss:</div></td>
              <td  align="right"><span id="Gneiss_m3">---</span></td>
              <td  align="right"><span id="Gneiss_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Dark Ochre:</div></td>
              <td  align="right"><span id="DarkOchre_m3">---</span></td>
              <td  align="right"><span id="DarkOchre_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Crokite:</div></td>
              <td  align="right"><span id="Crokite_m3">---</span></td>
              <td  align="right"><span id="Crokite_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Bistot:</div></td>
              <td  align="right"><span id="Bistot_m3">---</span></td>
              <td  align="right"><span id="Bistot_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Arkonor:</div></td>
              <td  align="right"><span id="Arkonor_m3">---</span></td>
              <td  align="right"><span id="Arkonor_Unit">---</span></td>
        </tr>
            <tr>
              <td ><div align="right">Mercoxit:</div></td>
              <td  align="right"><span id="Mercoxit_m3">---</span></td>
              <td  align="right"><span id="Mercoxit_Unit">---</span></td>
            </tr>
    </table>
	<p align="center">Update prices accordingly and the form will automatically update.<br>
	  Programming still in progress to automate prices and report.<br>
Printed rates are based on the Market Rates at time of Buy Chart update..<br>
	  In-game Operation not guarenteed.<br>
	  Best used with Firefox or Internet Exploder.</p>
        </div>
        </div>
        <div id="footerwrap">
        <div id="footer" align="center">
         <? include "../footer.php"; ?>
        </div>
        </div>
    </div>
</body>
</html>
